package com.example.dao;

import com.example.model.pojo.LikeDiscussion;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;

@Transactional
public interface LikeDiscussDao extends JpaRepository<LikeDiscussion,Integer> {
    @Query(value= "select count(*) from like_discussion where discuss_id=?1",nativeQuery=true )
    Integer getDiscussCount(Integer disscussid);
    @Query(value="select count(*) from like_discussion where uuid=?1 and discuss_id=?2",nativeQuery=true)
    Integer getlikes(Integer id,Integer discussid);
}
